﻿<TestCase testName="Example Test to show Tracing Pattern">
	<TestSetup>
		<!-- Start the event trace-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.StartRealtimeEventTrace">
			<TraceToolPath>..\..\..\BTS.Testing.TraceMonitor\bin\debug\BTS.Testing.TraceMonitor.exe</TraceToolPath>
		</TestStep>
	</TestSetup>
	<TestExecution>
		<!-- Log start event-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.ExampleTraceStep">
			<TraceMessage>message 1</TraceMessage>
		</TestStep>
		
		<!-- Check for event at front of queue-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.PollForNextEvent">
			<DeleteAfterFound>false</DeleteAfterFound>
			<IncludeBodyCompare>true</IncludeBodyCompare>
			<QueuePath>.\private$\BTS.Testing.TraceMonitor</QueuePath>
			<RegEx>message 1</RegEx>
			<TimeoutSeconds>10</TimeoutSeconds>
		</TestStep>

		<!-- Add some more trace messages-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.ExampleTraceStep">
			<TraceMessage>message 2</TraceMessage>
		</TestStep>
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.ExampleTraceStep">
			<TraceMessage>message 3</TraceMessage>
		</TestStep>

		<!-- Check for event anywhere in queue-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.PollForEvent">
			<DeleteAfterFound>false</DeleteAfterFound>
			<IncludeBodyCompare>true</IncludeBodyCompare>
			<QueuePath>.\private$\BTS.Testing.TraceMonitor</QueuePath>
			<RegEx>message 1</RegEx>
			<TimeoutSeconds>10</TimeoutSeconds>
		</TestStep>

		<!-- Check for event next in queue with delete through each event logged-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.PollForNextEvent">
			<DeleteAfterFound>true</DeleteAfterFound>
			<IncludeBodyCompare>true</IncludeBodyCompare>
			<QueuePath>.\private$\BTS.Testing.TraceMonitor</QueuePath>
			<RegEx>message 1</RegEx>
			<TimeoutSeconds>10</TimeoutSeconds>
		</TestStep>
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.PollForNextEvent">
			<DeleteAfterFound>true</DeleteAfterFound>
			<IncludeBodyCompare>true</IncludeBodyCompare>
			<QueuePath>.\private$\BTS.Testing.TraceMonitor</QueuePath>
			<RegEx>message 2</RegEx>
			<TimeoutSeconds>10</TimeoutSeconds>
		</TestStep>
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.PollForNextEvent">
			<DeleteAfterFound>true</DeleteAfterFound>
			<IncludeBodyCompare>true</IncludeBodyCompare>
			<QueuePath>.\private$\BTS.Testing.TraceMonitor</QueuePath>
			<RegEx>message 3</RegEx>
			<TimeoutSeconds>10</TimeoutSeconds>
		</TestStep>
	</TestExecution>
	<TestCleanup>
		
		<!-- Stop the event trace-->
		<TestStep assemblyPath="BTS.Testing.TraceMonitor.BizUnitSteps.dll" typeName="BTS.Testing.TraceMonitor.BizUnitSteps.StopRealtimeEventTrace">
		</TestStep>
	</TestCleanup>

</TestCase>